package cm.day05.Test2;

public class StringHandlerDemo {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String print) {
                System.out.println("调用方法");
            }
        });
        useStringHandler((String print) -> {
            System.out.println("方法参数");
        });
    }

    public static void useStringHandler(StringHandler stringHandler) {
        stringHandler.printMessage("过期");
    }
}
